Electronic devices, such as laptops, smartphones, tablet computers and the like, include built-in storage media for data storage purposes. Examples of such storage media may include, hard disk drives, read only memory (ROM), random access memory (RAM), and the like. Allocation of storage space within the storage media is typically managed in the electronic devices using computer file systems such as a file allocation table (FAT) file system. The FAT file system maintains a file allocation table (also referred to herein as “FAT”) as a directory of the contents of the storage media. Each storage location (for example, a block or a cluster of the storage space) in the storage media is associated with a corresponding entry in the FAT.
During a file write operation, a number of clusters are allocated either sequentially or in a random manner, based upon the availability of the storage space, to the file. Accordingly, the file is associated with a number of FAT entries indicating the cluster numbers including content corresponding to the file. During a file read operation, a FAT entry associated with a starting cluster of the file is located from another file directory maintained by the FAT file system. The FAT entry associated with the starting cluster of the file identifies a cluster number of a second cluster of the file. The FAT entry of the second cluster identifies a cluster number of a third cluster of the file, and so on and so forth. Accordingly, in order to access a file stored in the storage media, the FAT file system reads the FAT entries (irrespective of whether the clusters are contiguously allocated or not) in order to identify the clusters associated with the file. As a result of repeated back and forth switching between the reading of the FAT entry and the reading of the cluster from the storage media by the FAT file system, a file read performance is degraded.
U.S. patent application Ser. No. 12/389,391, titled “Contiguous file allocation in an extensible file system” and filed on Feb. 20, 2009, suggests a use of stream directory for an extensible file system (exFAT). Stream extension directory entries include general secondary flags to indicate that the clusters associated with the file are logically or physically contiguous on the storage media. This scheme improves the file read performance. The U.S. patent application Ser. No. 12/612,178, titled “Interface techniques providing contiguous storage for files” and filed on Nov. 4, 2009, suggests a use of a directory structure in an exFAT file system. The U.S. Pat. No. 8,321,439, titled “Quick filename lookup using name hash” and filed on Feb. 20, 2009, suggests a use of stream extension directory in the exFAT file system. However, the techniques suggested in these references are not applicable to FAT file systems as the stream extension directory entries are not FAT file system compatible. Accordingly, the stream extension directory entries corrupt the FAT file system and hence this method is restricted only to the exFAT file system.